package com.home.qh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.home.qh.dao.CommodityTypeDao;
import com.home.qh.model.CommodityType;
import com.home.qh.service.CommodityTypeManager;

/**
 * Implementation of RoleManager interface.
 *
 * @author <a href="mailto:dan@getrolling.com">Dan Kibler</a>
 */
@Service("commodityTypeManager")
public class CommodityTypeManagerImpl extends GenericManagerImpl<CommodityType, Long> implements CommodityTypeManager {
	CommodityTypeDao commodityTypeDao;

    @Autowired
    public CommodityTypeManagerImpl(CommodityTypeDao commodityTypeDao) {
        super(commodityTypeDao);
        this.commodityTypeDao = commodityTypeDao;
    }

	public List<CommodityType> getCommodityTypeByCodeAndName(String commodityTypeCode,
			String commodityTypeName) {
		return commodityTypeDao.getCommodityTypeByCodeAndName(commodityTypeCode, commodityTypeName);
	}

	public List<CommodityType> getCommodityTypeByCommodityType(CommodityType commodityType, String sort, boolean desc, int startResult, int maxResults) {
		return commodityTypeDao.getCommodityTypeByCommodityType(commodityType, sort, desc, startResult, maxResults);
	}

}